package com.cowin.inf.dao;

import com.cowin.base.Mapper;
import com.cowin.inf.model.KyLineState;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by  on 2019/09/19.
 *
 * @author CodeGenerator
 */
public interface KyLineStateMapper extends Mapper<KyLineState> {
    /**
     * 功能描述: WebSocket 初始化 加载工厂车间所有产线状态<br>
     *
     * @param plantNo    工厂
     * @param workShopNo 车间
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2019/9/21 15:03
     */
    @Select("SELECT * FROM KY_LINE_STATE WHERE PLANT_NO = #{plantNo}  AND WORK_SHOP_NO = #{workShopNo}")
    List<KyLineState> initLineState(@Param("plantNo") String plantNo, @Param("workShopNo") String workShopNo);

    /**
     * 功能描述: 根据工厂 产线 车间 查询<br>
     *
     * @param plantNo    工厂
     * @param workShopNo 车间
     * @param lineNo     产线
     * @return: KyLineState
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2019/9/21 15:02
     */
    @Select("SELECT * FROM KY_LINE_STATE WHERE PLANT_NO = #{plantNo}  AND WORK_SHOP_NO = #{workShopNo} AND LINE_NO = #{lineNo} ")
    List<KyLineState> selectByPlantWorkShopLineNo(@Param("plantNo") String plantNo, @Param("workShopNo") String workShopNo, @Param("lineNo") String lineNo);

    /**
     * 功能描述: 查询线体状态<br>
     *
     * @param
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2020/1/13 11:58
     */
    @Select("SELECT * FROM KY_LINE_STATE where WORK_SHOP_NO=#{workShopNo} and LINE_NO=#{lineNo}")
    KyLineState getLineState(@Param("workShopNo") String workShopNo, @Param("lineNo") String lineNo);
}